package com.woniuxy.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.dto.GoodBrandGeneralDto;
import com.woniuxy.dto.WarehouseShopDto;
import com.woniuxy.entity.GoodsBrandGeneral;
import com.woniuxy.mapper.GoodsBrandGeneralMapper;
import com.woniuxy.service.GoodsBrandGeneralService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.util.WoniuBeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 品牌管理(商品配置) 服务实现类
 * </p>
 *
 * @author zcx,ftl,gr,rhs
 * @since 2022-01-06
 */
@Service
public class GoodsBrandGeneralServiceImpl extends ServiceImpl<GoodsBrandGeneralMapper, GoodsBrandGeneral> implements GoodsBrandGeneralService {

    @Override
    public List<GoodBrandGeneralDto> listByBrandId(Integer id) {

        List<GoodsBrandGeneral> list = list(new QueryWrapper<GoodsBrandGeneral>().eq("brand_id", id));
        List<GoodBrandGeneralDto> goodBrandGeneralDtos = WoniuBeanUtils.copyList(list, GoodBrandGeneralDto.class);
        return goodBrandGeneralDtos;
    }
}
